<template>
    <div>
        <Form :show-message="false" label-position="top" >
            <Row :gutter="16">
                <Col span="12">
                    <FormItem label="公司名称">
                        <Input class="width90" v-model="data.enterpriseName" readonly/>
                    </FormItem>
                </Col>
                <Col span="12">
                    <FormItem label="项目名称" >
                        <Input class="width90" v-model="data.projectName" readonly/>
                    </FormItem>
                </Col>
                <Col span="12">
                    <FormItem label="工点名称">
                        <Input class="width90" v-model="data.pointName" readonly/>
                    </FormItem>
                </Col>
                <Col span="12">
                    <FormItem label="工点风险等级">
                        <Input class="width90" v-model="data.pointRiskGradeName"  readonly/>
                    </FormItem>
                </Col>
                <Col span="12">
                    <FormItem label="起始时间">
                        <Input class="width90" v-model="data.startTime" readonly/>
                    </FormItem>
                </Col>
                <Col span="12">
                    <FormItem label="结束时间">
                        <Input class="width90" v-model="data.endTime" readonly/>
                    </FormItem>
                </Col>
                <Col span="12">
                    <FormItem label="当月是否作业">
                        <Input class="width90" v-model="data.isThisMonthWorked" readonly/>
                    </FormItem>
                </Col>
                <Col span="24">
                    <FormItem label="工点描述">
                        <Input style="width: 95%" type="textarea" v-model="data.constructionPointDescription" readonly/>
                    </FormItem>
                </Col>
                <Col span="12">
                    <FormItem label="作业风险名称">
                        <Input class="width90" v-model="data.riskOperationName"  readonly/>
                    </FormItem>
                </Col>
                <Col span="12">
                    <FormItem label="作业风险类型">
                        <Input class="width90" v-model="data.riskCategoryNames" readonly/>
                    </FormItem>
                </Col>
                <Col span="12">
                    <FormItem label="作业风险等级">
                        <Input class="width90" v-model="data.riskLevelName" readonly/>
                    </FormItem>
                </Col>
                <Col span="12">
                    <FormItem label="分级方法">
                        <Input class="width90" v-model="data.classificationMethodName" readonly/>
                    </FormItem>
                </Col>
                <Col span="24">
                    <FormItem label="具体风险描述">
                        <Input style="width: 95%" type="textarea" v-model="data.riskDescription" readonly/>
                    </FormItem>
                </Col>
                <Col span="24">
                    <FormItem label="工程公司管控要求">
                        <Input style="width: 95%" type="textarea" v-model="data.engineeringCompanyRegulatoryRequirements" readonly/>
                    </FormItem>
                </Col>
                <Col span="24">
                    <FormItem label="集团公司管控要求">
                        <Input style="width: 95%" type="textarea" v-model="data.groupCompanyRegulatoryRequirements" readonly/>
                    </FormItem>
                </Col>
                <Col span="24">
                    <FormItem label="目前该风险安全控制情况">
                        <Input style="width: 95%" type="textarea" v-model="data.currentSaftyControlOfTheRisk" readonly/>
                    </FormItem>
                </Col>
            </Row>
        </Form>
    </div>
</template>
<script>
export default {
    props:['detailObj'],
    data(){
        return{
            data:{}
        }
    },
    filters:{
        riskLevel(type){
            if(type == 1){
                return 'Ⅰ级'
            }else if(type == 2){
                return 'Ⅱ级'
            }else if(type == 3){
                return 'Ⅲ级'
            }else{
                return 'Ⅳ级'
            }
        }
    },
    methods: {
        setData(){
            setTimeout(()=>{
                this.$set(this.data,'enterpriseName',this.detailObj.enterpriseName)
                this.$set(this.data,'projectName',this.detailObj.projectName)
                this.$set(this.data,'pointName',this.detailObj.pointName)
                this.$set(this.data,'pointRiskGradeName',this.detailObj.pointRiskGradeName)
                this.$set(this.data,'startTime',this.detailObj.startTime)
                this.$set(this.data,'endTime',this.detailObj.endTime)
                this.$set(this.data,'isThisMonthWorked',this.detailObj.isThisMonthWorked ? this.detailObj.isThisMonthWorked : this.detailObj.isWork)
                this.$set(this.data,'constructionPointDescription',this.detailObj.note)

                this.$set(this.data,'riskOperationName',this.detailObj.riskOperationDtoList ? this.detailObj.riskOperationDtoList[0].riskOperationName : this.detailObj.riskOperationName)
                this.$set(this.data,'riskCategoryNames',this.detailObj.riskOperationDtoList ? this.detailObj.riskOperationDtoList[0].riskCategoryNames : this.detailObj.riskCategoryNames)
                this.$set(this.data,'riskLevelName',this.detailObj.riskOperationDtoList ? this.detailObj.riskOperationDtoList[0].riskLevelName : this.detailObj.riskLevelName)
                this.$set(this.data,'classificationMethodName',this.detailObj.riskOperationDtoList ? this.detailObj.riskOperationDtoList[0].classificationMethodName : this.detailObj.classificationMethodName)
                this.$set(this.data,'engineeringCompanyRegulatoryRequirements',this.detailObj.riskOperationDtoList ? this.detailObj.riskOperationDtoList[0].riskControlRequirementOne : this.detailObj.riskControlRequirementOne)
                
                this.data.riskDescription = this.detailObj.riskDescription
                // this.data.engineeringCompanyRegulatoryRequirements = this.detailObj.riskOperationDtoList ? this.detailObj.riskOperationDtoList[0].riskControlRequirementOne : this.detailObj.riskControlRequirementOne
                this.data.groupCompanyRegulatoryRequirements = this.detailObj.groupCompanyRegulatoryRequirements
                this.$set(this.data,'currentSaftyControlOfTheRisk',this.detailObj.riskOperationDtoList ? this.detailObj.riskOperationDtoList[0].riskControlDetailOne : this.detailObj.riskControlDetailOne)
                
            },1000)
        },
    }
}
</script>